package javaEEBasic.day04;

//电影操作类
public class MovieOperator {
    private Movie[] movies;

    public MovieOperator(Movie[] movies) {
        this.movies = movies;
    }
    public void printAllMovies() {
        System.out.println("所有电影信息如下：");
        for (int i = 0; i < movies.length; i++) {
            movies[i].printMovieLittleInfo();
        }
    }
    public void searchMovieById(int id) {
        for (int i = 0; i < movies.length; i++) {
            if (movies[i].getId() == id) {
                movies[i].printMovieInfo();
                return;
            }
        }
        System.out.println("没有找到该电影");
    }
}
